﻿<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}style.css">
<script type="text/javascript" language="javascript" src="{{STATIC_URL}}js/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" language="javascript" src="{{STATIC_URL}}js/jquery.form.js"></script>
<title>{% block title %}Главная | WTD{% endblock title %}</title>
</head>
<body>
	<div class="main_block">
		<div class="block left_block">
			<div class="block logo">
				<a class="invisible_link" href="/"><img src="{{STATIC_URL}}images/logo.png"></a>
			</div>
            {% if not user.is_authenticated %}
                <div class="container block">{% block login_form %}{% endblock %}</div>
            {% endif %}
            {% if user.is_authenticated %}
                <div class="container menu">
                    <li><a href="/groups/">Мои группы</a></li>
                </div>
			<div class="container">
        <div class="home_works">
            <ul>
                <li><a href="/tasks/">Все задания</a></li>
                <li><a href="/tasks/to_day/">Задания на сегодня</a></li>
                <li><a href="/tasks/from_day/">Задания с сегодня</a></li>
            </ul>
        </div>
       	<div class="sort_by">По предмету:</div>
        <div class="home_works">
          <ul>
            {% for subject in subjects %}
              <li><a href="/tasks/subject/{{ subject.id }}/">{{ subject.title }}</a></li>
            {% endfor %}
          </ul>
        </div>
				<div class="add">Добавить:</div>
				<div class="adding_list">
					<ul>
						<li><a href="/group/add/">Группу</a></li>
						<li><a href="/task/add/">Задание</a></li>
					</ul>
				</div>
			</div>
            {% endif %}
		</div>
	  	<div class="right_block">
            {% if user.is_authenticated %}
                <div class="block container">
                    <div id="mini_menu">
                        <div class="welcome_mini">
                            Привет, <a href="/profile/">{{ user.username }}</a>!
                            {% if user.is_staff %}
                                <span class="separator">|</span>
                                <a href="/admin/">Панель управления</a>
                            {% endif %}
                        </div>
                        <li>
                            <a href="/pm/">Личные сообщения</a>
                            {% if pm.unreaded > 0 %}
                                <span class="counter">{{ pm.unreaded }}</span>
                            {% endif %}
                        </li>
                        <span class="separator">|</span>
                        <li><a href="/profile/">Профиль</a></li>
                        <span class="separator">|</span>
                        <li><a href="/logout/">Выйти</a></li>
                    </div>
                </div>
            {% endif %}
            <div class="container content">
                {% block content %}
                {% endblock content %}
            </div>
		</div>
	</div>
    <div class="footer">
    </div>
</body>
</html>
